//
// Created by Soar Qin on 2017/8/31.
// Copyright (c) 2017 Soar Qin. All rights reserved.
//

#pragma once

#include "udp_endpoint.hh"

namespace core::async {

struct KCPEndpointContext;

class KCPEndpoint: public UDPEndpoint {
    DISABLE_CLASS_COPY(KCPEndpoint);
public:
    KCPEndpoint(Loop &loop);
    ~KCPEndpoint() override;

    bool assign(uint32_t conv, const IPAddr &to);

protected:
    void onRead(const void *buf, size_t size, const IPAddr &from) override;

private:
    KCPEndpointContext *kcp_;
};

}
